package src.lab02.test03;

import java.util.Scanner;
/**
 * Created by 林云志 on 2017/10/14.
 */
public class Calculate extends Student{
    public static void main(String[] args) {
        Student student = new Student();
        //属性
        int math = student.getMath();
        int English = student.getEnglish();
        int compter = student.getCompter();
        //方法

        System.out.println("总分为："+sum(math,English,compter));
        System.out.println("最高分为："+max(math,English,compter));
        System.out.println("最低分为："+min(math,English,compter));
        System.out.println("数学成绩为："+math+"   英语成绩为："+English+"   计算机成绩为："+compter);
    }

    static int sum(int grade1,int grade2,int grade3){
        int sum = grade1 + grade2 +grade3;
       return sum;
    }
    static int max(int grade1,int grade2,int grade3){
            int max = grade1;
            if (grade2 > max){
                max = grade2;
                if (grade3 > max){
                    max = grade3;
                }
        }
        if (grade3 > max){
            max = grade3;
        }
        return max;
    }
    static int min(int grade1,int grade2,int grade3){
        int min=grade1;
        if (grade2 < min){
            min = grade2;
            if (grade3<min){
                min = grade3;
            }
        }
        if (grade3 < min){
            min = grade3;
        }
        return min;
    }
}

